package com.huawei.hms.framework.network.restclient.hwhttp.trans;

import androidx.annotation.NonNull;
import com.huawei.hms.framework.common.StringUtils;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.ByteBuffer;

public class CronetOutputStream extends OutputStream {
    ByteBuffer byteBuffer;

    public CronetOutputStream(ByteBuffer byteBuffer) {
        this.byteBuffer = byteBuffer;
    }

    public void write(int i) throws IOException {
        write(StringUtils.getBytes(String.valueOf(i)));
    }

    public void write(@NonNull byte[] bArr) throws IOException {
        write(bArr, 0, bArr.length);
    }

    public void write(@NonNull byte[] bArr, int i, int i2) throws IOException {
        this.byteBuffer.put(bArr, i, i2);
    }
}
